package com.zdp.demo.mq;

import com.zdp.entity.base.R;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
@RestController
public class ProducerController {

    private final MessageProducer messageProducer;

    @RequestMapping("/test/send")
    public R<Object> send() {
        String message = messageProducer.syncSendMessage("test-topic", "", "hello rocketmq!");
        return R.ok(message);
    }
}
